package chapter01;

import java.util.Arrays;

public class Test27_Twodim {
    public static void main(String[] args) {
        //直接规定大小
        int[][] a = new int[3][4];
        System.out.println(Arrays.deepToString(a));
        //可以规定行数 列数不确定
        int[][] b = new int[3][];//None
        b[0] = new int[]{1, 2};
        b[1] = new int[3];
        b[2] = new int[4];
        System.out.println(Arrays.deepToString(b));
        //直接赋值
        int[][] c = {{1,2,3},{4,5,6},{7,8}};
        System.out.println(Arrays.deepToString(c));
        //曲其中值
        System.out.println(c[0][1]);
        //直接赋值
        c[0][1] = 100;
        System.out.println(c[0][1]);
        for(int i=0;i<c.length;i++){
            for(int j=0;j<c[i].length;j++){
                System.out.println(c[i][j]);
            }
        }
    }
}
